#pragma once

#include <gl/glew.h>
#define GLFW_DLL
#include <gl/glfw.h>

class Renderer{
    public:
        Renderer(int width, int height);

        void Initialise();
        void InitialiseProgram();
        void InitialiseVertexBuffer();
        void InitialiseVertexArrayObjects();

        void Reshape(int w, int h);


        void Draw();
        unsigned int Pick(int x, int y);

        static void GLFWCALL WindowResizeCallback(int w, int h);

    private:
        GLuint shaderProgram;
        GLuint fragShaderRef;
        GLuint vertShaderRef;

        GLuint vertexDataVBO;
        GLuint indexVBO;

        GLuint vao1;
//        GLuint vao2;

        GLint perspectiveMatrixUnf;
        GLint offsetUnf;

        float fFrustumScale;
        float fzNear;
        float fzFar;
        float perspectiveMatrix[16];

        int width;
        int height;
        int size;
};

extern Renderer* renderer;
